using Domain.Dto;
using Gmmy.DomainExtension;
using Gmmy.Utility;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Domain.Model
{
    /// <summary>
    /// 案例模型模型
    /// </summary>
    public class SampleModel : EntityBase
    {
		#region 领域对象属性
        /// <summary>
        /// 编号
        /// </summary>
        [DisplayName(@"编号")]
        [Key]
        public Guid ID { get; set; }

        /// <summary>
        /// 案例标题
        /// </summary>
        [DisplayName(@"案例标题")]
        public string Title { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName(@"创建时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 逻辑删除
        /// </summary>
        [DisplayName(@"逻辑删除")]
        public bool IsDeleted { get; set; }


        #endregion

		#region 领域对象行为
		public SampleModel() { }//空构造函数

		/// <summary>
        /// 创建案例模型
        /// </summary>
        /// <param name="input"></param>
        public SampleModel(SampleModelCreateInput input)
        {
            //todo:领域对象逻辑

            ID = Guid.NewGuid();
            Title = input.Title;

            CreateTime = DateTime.Now;
            IsDeleted = false;
        }
        /// <summary>
        /// 更新案例模型
        /// </summary>
        /// <param name="input"></param>
        public void Update(SampleModelUpdateInput input)
        {
            //todo:领域对象逻辑

            Title = input.Title;

        }

        #endregion

    }
}